﻿using System;

namespace ParallelLib
{
    public class EnvironmentUtil
    {
        public static readonly string MachineName;
        public static readonly string UserName;
        public static readonly string UserDomainName;
        public static readonly int ProcessorCount;

        /// <summary>
        /// 单位 byte
        /// </summary>
        public static readonly long WorkingSet;

        /// <summary>
        /// 单位 byte
        /// </summary>
        public static readonly long SystemPageSize;

        static EnvironmentUtil()
        {
            MachineName = Environment.MachineName;
            UserName = Environment.UserName;
            UserDomainName = Environment.UserDomainName;
            ProcessorCount = Environment.ProcessorCount;
            WorkingSet = Environment.WorkingSet;
            SystemPageSize = Environment.SystemPageSize;

            System.Diagnostics.Trace.WriteLine(MachineName);
            System.Diagnostics.Trace.WriteLine(UserName);
            System.Diagnostics.Trace.WriteLine(UserDomainName);
            System.Diagnostics.Trace.WriteLine(ProcessorCount);
            System.Diagnostics.Trace.WriteLine(WorkingSet);
            System.Diagnostics.Trace.WriteLine(SystemPageSize);
        }
    }
}